import numpy as np

class SimpleSVC:
    def __init__(self, C=1.0):
        self.C = C
        self.w = None
        self.b = None
        self.classifiers_ = {}

    def fit(self, X, y, n_iters=1000, lr=0.001):
        self.classes_ = np.unique(y)
        for cls in self.classes_:
            y_binary = np.where(y == cls, 1, -1)
            self.w = np.zeros(X.shape[1])
            self.b = 0

            for _ in range(n_iters):
                for idx, x_i in enumerate(X):
                    condition = y_binary[idx] * (np.dot(x_i, self.w) - self.b) >= 1
                    if condition:
                        self.w -= lr * (2 * self.w / self.C)
                    else:
                        self.w -= lr * (2 * self.w / self.C - np.dot(x_i, y_binary[idx]))
                        self.b -= lr * y_binary[idx]
            self.classifiers_[cls] = (self.w, self.b)

    def predict(self, X):
        scores = np.zeros((X.shape[0], len(self.classes_)))
        for cls, (w, b) in self.classifiers_.items():
            scores[:, cls] = np.dot(X, w) - b
        return np.argmax(scores, axis=1)

    def score(self, X, y):
        y_pred = self.predict(X)
        accuracy = np.sum(y_pred == y) / len(y)
        return accuracy

    def support_vectors_(self, X, y):
        y_ = np.where(y <= 0, -1, 1)
        support_vector_idx = np.where(y_ * (np.dot(X, self.w) - self.b) < 1)[0]
        return X[support_vector_idx]